package com.anda.account.domain.model.inventory;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.anda.account.domain.model.cash.Cash;

/**
 * 库存流水
 * @author Administrator
 *
 */
@Entity
public class Inventory {
	
	public static String SALE = "销售";
	public static String PURCHASE = "进货";
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long inventoryId; 
	
	private String businessCode;    //业务编号
	
	@ManyToOne(targetEntity=Product.class,fetch=FetchType.LAZY)
	@JoinColumn(name="productId",referencedColumnName="productId")
	private Product product;         //关联的商品，是对哪儿商品做的流水
	
	@ManyToOne(targetEntity=Supplier.class,fetch=FetchType.LAZY)
	@JoinColumn(name="supplierId",referencedColumnName="supplierId")
	private Supplier supplier;       //进货业务时的供应商
	
	private String supplierName;     //供应商名字
	
	@ManyToOne(targetEntity=Customer.class,fetch=FetchType.LAZY)
	@JoinColumn(name="customerId",referencedColumnName="customerId")
	private Customer customer;       //销售业务时的客户
	
	private String customerName;     //客户名字
	
	@ManyToOne(targetEntity=Cash.class,fetch=FetchType.LAZY)
	@JoinColumn(name="cashId",referencedColumnName="cashId")
	private Cash cash;               //所属的资金流水
	
	private String tradeType;        //业务类型
	
	private Date entryDate;          //入库时间
	private Date saleDate;           //出库时间 
	private String entryUser;        //进货录入人
	private String saleUser;         //销售录入人
	private String Inventorydesc;             //备注
	
	public Long getInventoryId() {
		return inventoryId;
	}
	public void setInventoryId(Long inventoryId) {
		this.inventoryId = inventoryId;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public Supplier getSupplier() {
		return supplier;
	}
	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public String getSupplierName() {
		return supplierName;
	}
	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public Cash getCash() {
		return cash;
	}
	public void setCash(Cash cash) {
		this.cash = cash;
	}
	public String getTradeType() {
		return tradeType;
	}
	public void setTradeType(String tradeType) {
		this.tradeType = tradeType;
	}
	public Date getEntryDate() {
		return entryDate;
	}
	public void setEntryDate(Date entryDate) {
		this.entryDate = entryDate;
	}
	public Date getSaleDate() {
		return saleDate;
	}
	public void setSaleDate(Date saleDate) {
		this.saleDate = saleDate;
	}
	public String getEntryUser() {
		return entryUser;
	}
	public void setEntryUser(String entryUser) {
		this.entryUser = entryUser;
	}
	public String getSaleUser() {
		return saleUser;
	}
	public void setSaleUser(String saleUser) {
		this.saleUser = saleUser;
	}
	public String getBusinessCode() {
		return businessCode;
	}
	public void setBusinessCode(String businessCode) {
		this.businessCode = businessCode;
	}
	public String getInventorydesc() {
		return Inventorydesc;
	}
	public void setInventorydesc(String inventorydesc) {
		Inventorydesc = inventorydesc;
	}

}
